<template>
  <div id="tab">
    <div class="tab-bar clearfix">
      <a
        href="javascript:;"
        @click="tab(index)"
        v-for="(item, index) in items"
        :class="{ active: index === curId }"
        v-bind:key="index"
        >{{ item.item }}</a
      >
    </div>
    <div class="vip-tips">
      <div class="label">折扣</div>
      <div class="label-text">开卡享优惠</div>
      <span>9.9元起开卡 &nbsp;></span>
    </div>
    <div class="tab-con">
      <div
        v-show="index === curId"
        v-for="(content, index) in contents"
        v-bind:key="index"
      >
        <div class="show-item-wrap" @click="fun()">
          <div class="show-item">
            <div class="begin">11:45</div>
            <div class="end">13:28<span class="tui">散场</span></div>
          </div>
          <div class="info-block">
            <div class="lan">国语 &nbsp;2D</div>
            <div class="hall">VIP5号女王厅（若3D影片建议自备3D眼镜）</div>
          </div>
          <div class="price">
            <div class="sellPr">
              <span class="d">￥</span>
              <span class="">29.9</span>
            </div>
            <div class="vipPrice">
              <span class="icon">折扣卡</span>
              <span class="num">￥ &nbsp;26.9</span>
            </div>
          </div>
          <div class="button-block">
            <div class="button">购票</div>
          </div>
        </div>
        <div class="show-item-wrap" @click="fun()">
          <div class="show-item">
            <div class="begin">10:40</div>
            <div class="end">15:20<span class="tui">散场</span></div>
          </div>
          <div class="info-block">
            <div class="lan">国语 &nbsp;2D</div>
            <div class="hall">VIP6号女王厅（若3D影片建议自备3D眼镜）</div>
          </div>
          <div class="price">
            <div class="sellPr">
              <span class="d">￥</span>
              <span class="">28.0</span>
            </div>
            <div class="vipPrice">
              <span class="icon">折扣卡</span>
              <span class="num">￥ &nbsp;22.8</span>
            </div>
          </div>
          <div class="button-block">
            <div class="button">购票</div>
          </div>
        </div>
        <div class="show-item-wrap" @click="fun()">
          <div class="show-item">
            <div class="begin">12:45</div>
            <div class="end">14:30<span class="tui">散场</span></div>
          </div>
          <div class="info-block">
            <div class="lan">国语 &nbsp;2D</div>
            <div class="hall">VIP3号女王厅（若3D影片建议自备3D眼镜）</div>
          </div>
          <div class="price">
            <div class="sellPr">
              <span class="d">￥</span>
              <span class="">33.5</span>
            </div>
            <div class="vipPrice">
              <span class="icon">折扣卡</span>
              <span class="num">￥ &nbsp;20.9</span>
            </div>
          </div>
          <div class="button-block">
            <div class="button">购票</div>
          </div>
        </div>
        <!-- {{ content.content }} -->
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      curId: 0,
      items: [{ item: "明天9月13日" }, { item: "后天9月14日" }],
      contents: [{ content: "JavaScript" }, { content: "Vue" }],
    };
  },
  methods: {
     fun() {
      this.$router.push({ path: "/seat" });
    },
    tab(index) {
      this.curId = index;
    },
  },
};
</script>
<style scoped>
.tab-bar a {
  line-height: 0.9rem;
  text-align: center;
  text-decoration: none;
  color: #000;
  margin-left: 0.3rem;
}
.tab-bar .active {
  color: red;
  border-bottom: 0.05rem solid red;
}
.vip-tips {
  background-color: #fff5ea;
  padding: 0 0.3rem;
  display: flex;
  line-height: 0.8rem;
}
.label {
  background-color: #ff941a;
  margin-top: 0.26rem;
  color: #fff;
  text-align: center;
  height: 0.29rem;
  width: 0.7rem;
  font-size: 0.2rem;
  line-height: 0.25rem;
  margin-right: 0.17rem;
}
.label-text {
  font-size: 0.2rem;
  color: #fa9600;
}
.vip-tips span {
  color: #999;
  font-size: 0.25rem;
  margin-left: 3.3rem;
}
.show-item-wrap {
  padding: 17px 12.5px;
  display: flex;
}
.begin {
  font-size: 20px;
  color: #333;
  line-height: 1;
  white-space: nowrap;
}
.end {
  margin-top: 10px;
  color: #999;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.info-block {
  margin-left: 17px;
  -webkit-box-flex: 1;
  flex: 1;
}
.lan {
  margin-top: 2px;
  line-height: 18px;
  font-size: 13px;
  color: #333;
  white-space: normal;
}
.hall {
  margin-top: 7px;
  font-size: 11px;
  color: #999;
  white-space: normal;
}
.price {
  -webkit-box-flex: 0;

  flex: 0 1 auto;
  width: 130px;
  margin-left: 5px;
}
.sellPr {
  display: inline-block;
  line-height: 1;
  color: #f03d37;
  margin-top: 1px;
  font-size: 19px;
}
.d {
  font-size: 11px;
}
.vipPrice {
  display: inline-block;
  line-height: 15px;
  height: 15px;
  transform: scale(0.8);
  transform-origin: left;
  margin: 0 -16px 0 4px;
  border: 1px solid #ff9000;
  border-radius: 2px;
  font-size: 12px;
}
.icon {
  display: inline-block;
  color: #fff;
  background-color: #f90;
}
.num {
  display: inline-block;
  padding: 0 2px;
  color: #f90;
  background-color: #fff;
}
.button-block {
  width: 45px;
  margin-left: 2px;
  position: relative;
}
.button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 27px;
  line-height: 28px;
  font-size: 12px;
  background-color: #f03d37;
  color: #fff;
  border-radius: 4px;
  text-align: center;
}
</style>